
<!DOCTYPE html>
<html>
<head>
{inc:"incs/weys~imp"}
<title><?=$title='Sudoku|数独'?> - [shù dú] </title>
<link href='<?=tpath()?>/sudoku.css?<?=time()?>' rel='stylesheet'/>
<script src="<?=tpath()?>/sudoku.js?<?=time()?>"></script>
<style type="text/css">

</style>
</head>
<body>

{inc:"incs/peace~head"}

<article class="">

  <p class="infoTop" id='info'>(Sudoku) 数独 [shù dú]</p>

  <table cellpadding="0" cellspacing="0" id="sdtab">
    <?php for($i=1;$i<10;$i++){ $css1 = in_array($i,[3,6]) ? 'bdb ' : ''; ?>
    <tr>
      <?php for($j=1;$j<10;$j++){ $css2 = in_array($j,[3,6]) ? 'bdr' : ''; ?>
        <td id='c<?=$i.$j?>' class="<?=$css1.$css2?>">-</td>
      <?php } ?>
    </tr>
    <?php } ?>
  </table>

  <table cellpadding="0" cellspacing="0" class="optab">
    <tr id='acts'>
      <td>
        <a onclick="setGameBtn();">出题</a>
        <a onclick="dataOps('imp')">导入</a>
        <a onclick="dataOps('out')">导出</a>
      </td>
      <td>
        <a onclick="setNop()">试<i class="fa fa-sliders"></i></a>
        <a id='btnvTip' class="xph1" onclick="tipOne()" style="display:none"><i class="fa fa-lightbulb-o"></i></a>
        <a id='btnhTip' class="gray xph1"><i class="fa fa-lightbulb-o"></i></a>
        <a onclick="backOne()" class="xph1"><i class="fa fa-undo"></i></a>
        <a onclick="endGame()"><i class="fa fa-stop-circle-o"></i>完</a>
      </td>
    </tr>
  </table>

  <table cellpadding="0" cellspacing="0" class="optab" id='opt2' style="display:none">
    <tr>
      <td>
        <a onclick="setGame(0.30);">+易</a>
        <a onclick="setGame(0.40);">易</a>
        <a onclick="setGame(0.50);">中</a>
        <a onclick="setGame(0.60);">难</a>
        <a onclick="setGame(0.70);">难+</a>
      </td>
      <td>
        <a class="gray">拍照</a>
        <a onclick="inpStart()">录题</a> 
        <a onclick="inpEnd()">录完</a>
      </td>
    </tr>
  </table>

  <table cellpadding="0" cellspacing="0" class="optab" id='drow' style="display:none">
    <tr>
      <td width="88%">
        <input type="text" id="data" class="pw99">
      </td>
      <td>
        <a onclick="dataOps('do')">OK</a>
      </td>
    </tr>
    <tr>
      <td colspan="2">
        <select id='pick' onchange="dataPick(this)" class="pw99">
            <option value="">-请选择-</option>
        </select>
      </td>
    </tr>
  </table>

  <table cellpadding="0" cellspacing="0" class="optab" id='nums'>
    <tr>
      <?php for($j=1;$j<10;$j++){ ?>
        <td class="xbig" onclick="setOne(this)"><?=$j?></td>
      <?php } ?>
    </tr>
    <!--tr>
      <?php for($j=1;$j<10;$j++){ ?>
        <td class="" onclick="setOne(this)">-<?=$j?></td>
      <?php } ?>
    </tr-->
  </table>
  <div class="brdtp"></div>

  <p>(Sudoku) 数独 [shù dú] 是一种数字推理逻辑游戏。  </p>
  <p>数独盘面是个九宫，每一宫又分为九个小格，所以又称“九宫格”；根据9×9盘面上的已知数字，推理出所有剩余空格的数字，并满足每一行、每一列、每一个粗线宫（3*3）内的数字均含1-9，不重复 。</p>

</article>


<div id='dtipOk' style="opacity:1;display:none;">
    <div class="mask"></div>
    <div class="dialog">
        <i class="fa fa-close close" onclick="opDialog(this)"></i>
        <div class="shead">解答结果</div>
        <div class="bd">
            <p class="tc">你真棒！<br><span id="onCnt"></span>个空格全部正确!</p>
        </div>
        <div class="shead">
            <a class="" onclick="setGame(defLevel);opDialog($(this).parent())">出题</a>
            -
            <a class="" onclick="dataOps('imp');opDialog($(this).parent())">导入</a>
            -
            <a class="" onclick="dataOps('out');opDialog($(this).parent())">导出</a>
        </div>
    </div>
</div>


<script>
var data = '<?=req('data')?>', picked = 0, defLevel = 0.50;
  sudataUrl = '<?=tpath()?>/sudata.json';

if(data){
    $('#data').val(data);
    $('#drow').attr('rel','imp');
    dataOps('do');
    setInfo();
}else{
    setGame(defLevel);
}
</script>


{inc:"incs/weys~foot"}

</body>
</html>
